'use strict';

module.exports = app => {
  const { STRING, INTEGER, DECIMAL, TINYINT } = app.Sequelize;

  const User = app.model.define('user', {
    userid: {
      type: INTEGER,
      primaryKey: true,
      autoIncrement: true,
    },
    username: STRING(20),
    password: STRING(32),
    openid: STRING(255),
    credit: DECIMAL(10, 2),
    create_time: INTEGER,
    update_time: INTEGER,
    login_time: INTEGER,
    status: TINYINT,
    delete_time: INTEGER,
  });

  return User;
};
